package com.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.store.entity.OrderItem;
import com.store.vo.OrderItemVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

/**
 * 订单明细Mapper接口
 */
@Mapper
public interface OrderItemMapper extends BaseMapper<OrderItem> {
    
    /**
     * 查询订单明细列表
     */
    @Select("SELECT id, order_id, product_id, product_name, product_image, price, quantity, subtotal " +
            "FROM order_items WHERE order_id = #{orderId}")
    List<OrderItemVO> selectByOrderId(@Param("orderId") Long orderId);
}


